{layout name="daili/layout"}
<main class="app-content">
  <div class="app-title">

    <ul class="app-breadcrumb breadcrumb">
      <li class="breadcrumb-item"><i class="fa fa-home fa-lg"></i></li>
      <li class="breadcrumb-item">代理后台</li>
      <li class="breadcrumb-item"><a href="#">资金管理</a></li>
    </ul>
  </div>
  <div class="row">

    <div class="clearix"></div>
    <div class="col-lg-12">
      <div class="bs-component">
        <div class="alert alert-dismissible alert-success">
          <button class="close" type="button" data-dismiss="alert">×</button> <b>申请提现将扣除手续费,记录,到账均为实际提现金额,请知晓!</b> </a>.
        </div>
      </div>
    </div>
    <div class="col-md-12">
      <div class="tile">
        <h3 class="tile-title">当前余额:<a style="color:red"> {$yue}</a> </h3>
        <div class="tile-body">
          
            <div class="form-group col-md-3">
              <label class="control-label">提现余额</label>
              <input name="money" class="form-control" max="{$yue}" type="number" placeholder="{$yue}">
            </div>
            <div class="form-group col-md-3">
              <label class="control-label">提现账户</label>
              <input name="wallet" class="form-control" type="text" placeholder="支付账户:1xxxxxx">
            </div>
            <div class="form-group col-md-4 align-self-end">
              <button onclick="go();" class="btn btn-primary" type="button"><i class="fa fa-fw fa-lg fa-check-circle"></i>申请提现</button>
            </div>
     
        </div>
      </div>
    </div>
    <style> 
        .margin_clear{
          margin-bottom:0rem;
        }
    </style>
    <div class="col-md-12">
      <div class="tile">
        <h3 class="tile-title">最近提现记录</h3>
        <ul class="list-group">
          {foreach $txlist as $v} 
            <li class="list-group-item">
              {if condition="$v.tx_status == 0"}
              <span class="label label-default label-pill pull-right badge badge-secondary">正在处理</span>
              {elseif condition="$v.tx_status == 1" /}
              <span class="label label-default label-pill pull-right badge badge-success">提现成功</span>
              {else}
              <span class="label label-default label-pill pull-right badge badge-danger">提现失败</span>
              {/if}
              <span> 申请提现 :   <b style="font-size: 1rem"> {$v.tx_money}元</b>  </span>
           <div>时间:{$v->tx_time} </div>
            </li>
          {/foreach}
           
          </ul>
          <div style="margin-top:2rem;" id="pages">
              {$txlist->render()}
          </div>
      </div>
    
     
  
      <script>  
        $("#pages li span").attr('class','page-link');
        $("#pages li a").each((e,q)=>{
            console.log();
            if(typeof( $(q).attr('class')) == 'undefined'){
              $(q).attr('class',' page-link');
            }else{
              $(q).attr('class',$(q).attr('class')+' page-link');
            }
        })
      </script>



    </div>
  </div>
</main>
<script>
  var go = ()=>{


    if({$yue} < $("[name=money]").val() || $("[name=money]").val() < 1){ alert('余额不足');return false;}

      $.ajax('./yue.html',{
          data:{
            'money' :$("[name=money]").val(),
            'wallet':$("[name=wallet]").val(),
          },
          type:'POST',
          success:(data)=>{
            alert(data.msg);
            location = location;
          }
      })
  }
</script>